"""求最后一个单词的长度"""


class Solution:
    def lengthOfLastWord(self, s):
        s = s.strip().split(" ")
        if s:
            print(len(s[len(s)-1]))
        else:
            return 0

if __name__ == '__main__':
    str1 = "a "
    s = Solution()
    s.lengthOfLastWord(str1)
